package com.nariano.webapp;

import org.apache.wicket.PageParameters;
import org.apache.wicket.RequestCycle;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.link.Link;
import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.ListView;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.LoadableDetachableModel;
import org.apache.wicket.model.Model;
import org.apache.wicket.model.PropertyModel;

import com.nariano.server.domain.entities.User;
import com.nariano.server.services.cityservice.CityService;
import com.nariano.server.services.userservice.UserService;
import com.nariano.server.utils.spring.SpringFactory;

/**
 * Admin page
 */
public class AdminPage extends WebPage {

	private static final long serialVersionUID = 1L;

	
    /**
	 * Constructor that is invoked when page is invoked without a session.
	 * 
	 * @param parameters Page parameters
	 */
    public AdminPage() {

       if (NarianoSession.get().getUser() == null)
       {
    	   RequestCycle.get().setResponsePage(Index.class);
       }
       
       if (NarianoSession.get().getUser() == null
  		     || false == "pers".equals(NarianoSession.get().getUser().getUserName()))
     {
  	   RequestCycle.get().setResponsePage(Index.class);
     }

            
    }

}
